import { mapState } from "vuex";
export default {
	data() {
		return {
			modalName: '',
			windowHeight: 667
		}
	},
	props: {
		scrollBottom: Number,
		pageShow: Boolean,
		refreshStare: Boolean,
	},
	computed: {
		...mapState(['indexPage']),
	},
	
	watch: {
		scrollY() {
			this.setPageScroll(this.scrollY);
		},
		scrollBottom() {
			if (this.scrollBottom != 0) {
				this.setReachBottom();
			}
		},
		pageShow(nVal, oVal) {
			if (nVal != oVal) {
			    this.setOnShow();
			}
		},
		indexPage(nVal, oVal) {
			if (nVal != oVal) {
			    this.pageChange(nVal);
			}
		},
		refreshStare(nVal, oVal) {
			if (nVal != oVal) {
			    this.refresh(nVal);
			}
		}
	},
	mounted() {
		this.windowHeight = this.systemInfo.windowHeight
		this.setOnShow();
		uni.pageScrollTo({
			scrollTop: 0,
			duration: 0
		});
	},
	methods: {
		//触底了
		setReachBottom() {},
		//页面被滚动
		setPageScroll(e) {},
		setOnShow() {},
		pageChange(page) {},
		refresh() {},
		showModal(e) {
			this.modalName = e.currentTarget.dataset.target
		},
		hideModal(e) {
			this.modalName = null
		},
		stopClick() {
			return false
		}
	}
}
